<?php
class Roster extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}

	//default roster page, currently hte only one
	function index() {

		$this->load->model('roster_model');
		$this->load->library('table');
		
		$params['subview'] = 'subview/roster_view';
		$params['roster_model'] = &$this->roster_model;
		$params['table_library'] = &$this->table;
		
		$this->load->view('homepage_view', $params);

	}
	
	//Modify order of a user
	function change_order() {
		$account = $this->input->post('user');
		$new_access = $this->input->post('order');
		
		if(!empty($account)){
			$this->load->model('profile_model');
			$this->profile_model->update_field($account, 'order', $new_access);
		}
		
		redirect('homepage/control');
	}
	
}
